﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="SilverChat.aspx.cs" Inherits="Contents_SilverChat" %>

<%@ Register src="../Controls/SilverChatControl.ascx" tagname="SilverChatControl" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>

<div style="height: 600px; width: 600px;">
		<silver:Silverlight ID="XamlChat" runat="server" Source="~/ClientBin/SilverlChat.xap"
				MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
</div>
	<script type="text/javascript" language="javascript">

  //get_Chats();

		function caricaChatRooms(res) {
		  alert('Ok');
		  var silver = document.getElementById("XamlChat");
		  //alert(silver);
		  var silver2 = document.getElementById("ctl00_ContentPlaceHolder1_XamlChat");
		  alert(silver2);
		  alert(res.toString());
		  alert(typeof (res));
		  var json = Sys.Serialization.JavaScriptSerializer.serialize(res);

		  alert(res[0].ID);    
    silver2.content.Page.caricaChatRoooms(res,json);
		} //fM

		function get_Chats() {
		  alert('In get chats');
		  PageMethods.getMyChats(caricaChatRooms, CallFailed, null);

		} //fm
		
		function CallFailed(res, destCtrl) {
        alert("Errore... "+res.get_message());
    }
					
		
</script>


		
	<%--	<asp:UpdatePanel ID="UpdatePanel1" runat="server">
		<ContentTemplate>

				<uc1:SilverChatControl ID="SilverChatControl1" runat="server" />

</ContentTemplate>
		</asp:UpdatePanel>--%>
		
	

		
		
		
		

</asp:Content>

